package com.itfenghuang.day13_练习;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class 服务端 {
    public static void main(String[] args) throws IOException {
        ServerSocket sk = new ServerSocket(12345);
        Socket zz = sk.accept();
        InputStream is = zz.getInputStream();
        byte[] xx=new byte[1024];
        int aa = is.read(xx);
        System.out.println(new String(xx,0,aa));
        OutputStream ots = zz.getOutputStream();
        ots.write("臭狗屎".getBytes());
        sk.close();
    }
}
